package Leetcode.array;

public class SingleNumber {

    public int singleNumber(int[] nums) {
        int t=nums[0];
         for(int i=1;i<nums.length;i++){
             t=t^nums[i];
         }
      return t;
    }

    public static void main(String[] args){
        int[] a={1,2,1,2,4};
        SingleNumber singleNumber =new SingleNumber();
        int t= singleNumber.singleNumber(a);
        System.out.println(t);

    }
}
